package com.hjq.www.Dao.Impl;

import com.hjq.www.po.User;

import java.sql.Connection;
import java.sql.PreparedStatement;
/**
 * Create with IntelliJ IDEA
 *
 * @author: hjq
 * @Date:
 * @Description:
 */
public class UserRegisterDao {
    public int register(Connection conn, User user) throws Exception{
        String sql= "insert into user values(null,?,?,?,?)";
        PreparedStatement ps = conn.prepareStatement(sql);
        ps.setString(1, user.getUsername());
        ps.setString(2, user.getPwd());
        ps.setString(3, user.getPhone());
        ps.setString(4, user.getCardNumber());
        return ps.executeUpdate();
    }
}
